package com.lingyu.jsjx.domain;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 文档管理对象 jsjx_user_document
 *
 * @author ruoyi
 * @date 2025-07-31
 */
@Getter
@Setter
@TableName("jsjx_user_document")
public class UserDocument extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "word_id", type = IdType.AUTO)
    private Long wordId;

    /**
     * 标题
     */
    @Excel(name = "标题")
    @NotBlank(message = "标题不能为空")
    private String wordTitle;

    /**
     * 共享时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "共享时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date shareTime;

    /**
     * 类别id
     */
    @NotNull(message = "类别不能为空")
    private Long categoryId;

    /**
     * 类别name
     */
    @Excel(name = "类别")
    private String categoryName;

    /**
     * 所属学院id
     */
    @NotNull(message = "所属学院不能为空")
    private Long collageId;

    /**
     * 所属学院name
     */
    @Excel(name = "所属学院")
    private String collageName;

    /**
     * 所属专业id
     */
    @NotNull(message = "所属专业不能为空")
    private Long majorId;

    /**
     * 所属专业name
     */
    @Excel(name = "所属专业")
    private String majorName;

    /**
     * 描述
     */
    @Excel(name = "描述")
    private String description;

    /**
     * 文件
     */
    @NotBlank(message = "文件不能为空")
    private String fileId;

    @TableField(exist = false)
    private List<FileInfo> fileInfo;
    /**
     * 是否共享
     **/
    private int allowShare;

    /**
     * 下载量
     */
    private int downloadNum;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("wordId", getWordId())
                .append("wordTitle", getWordTitle())
                .append("shareTime", getShareTime())
                .append("categoryId", getCategoryId())
                .append("categoryName", getCategoryName())
                .append("collageId", getCollageId())
                .append("collageName", getCollageName())
                .append("majorId", getMajorId())
                .append("majorName", getMajorName())
                .append("description", getDescription())
                .append("fileId", getFileId())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
